<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>修改线路</title>
    <link rel="stylesheet" type="text/css" href="css/index.css"/>
</head>
<body>
<jsp:include page="menu.jsp"/>
<div class="index-content">
    <div class="index-content-operation">
        <a class="info-detail">修改线路</a>
        <br>
        <br>
    </div>
    <br>
    <form action="XianluServlet?action=edit" method="post" onsubmit="return check()">
        <input type="hidden" id="id" name="id" value="${vo.id}"/>
        
        <table class="index-content-table-add">
            <tr>
                <td width="12%">线路名称：</td><td><input class="index-content-table-td-add" type="text" id="xianluName" name="xianluName" value="${vo.xianluName}"/></td>
            </tr>
            <tr>
                <td width="12%">发布日期：</td><td><input class="index-content-table-td-add" type="text" id="xianluDate" name="xianluDate" value="${vo.xianluDate}"/></td>
            </tr>
            <tr>
                <td width="12%">开始地点：</td><td><input class="index-content-table-td-add" type="text" id="xianluStart" name="xianluStart" value="${vo.xianluStart}"/></td>
            </tr>
            <tr>
                <td width="12%">结束地点：</td><td><input class="index-content-table-td-add" type="text" id="xianluEnd" name="xianluEnd" value="${vo.xianluEnd}"/></td>
            </tr>
            <tr>
                <td width="12%">说明：</td><td><textarea id="xianluText" name="xianluText" style="width: 60%; height: 100px;padding: 0px 17px;" placeholder="请输入内容......">${vo.xianluText}</textarea></td>
            </tr>
        </table>
        <br>
        <br>
        <br>
        &nbsp;&nbsp;&nbsp;<button type="submit" class="btn btn-pill btn-line btn-success btn-sm">提交</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" class="btn btn-pill btn-line btn-success btn-sm" onclick="javascript:history.back(-1);">取消</button>
    </form>
</div>

</body>
<script type="text/javascript">
    //提交之前进行检查，如果return false，则不允许提交
    function check() {
        //根据ID获取值
        if (document.getElementById("xianluName").value.trim().length == 0) {
            alert("线路名称不能为空!");
            return false;
        }
        if (document.getElementById("xianluDate").value.trim().length == 0) {
            alert("发布日期不能为空!");
            return false;
        }
        if (document.getElementById("xianluStart").value.trim().length == 0) {
            alert("开始地点不能为空!");
            return false;
        }
        if (document.getElementById("xianluEnd").value.trim().length == 0) {
            alert("结束地点不能为空!");
            return false;
        }
        return true;
    }
</script>
</html>
